// 该文件负责发送购物车相关数据请求
import request from '@/utils/request'

export function insertCartApi({ skuId, count }) {
    return request({
        url: '/member/cart',
        method: 'POST',
        data: {
            skuId,
            count
        }
    })
}

export function getNewCartListApi() {
    return request({
        url: '/member/cart'
    })
}

export function delCartListApi(ids) {
    return request({
        url: '/member/cart',
        method: 'DELETE',
        data: {
            ids
        }
    })
}

// 合并购物车，data是数组对象
export function mergeCartApi(data) {
    return request({
        url: '/member/cart/merge',
        method: 'POST',
        data
    })
}